
<style>
    #img_fix .img_fix{
        display: inline-block;
        width:100px;
        height:80px;
    }
    .sc_imgbox{  float:left;}
    .sc_btn{ width:100px; height:40px; text-align:center; line-height:40px; background:#ff9a00; font-size:16px; color:#fff; border-radius:3px; margin-top:20px; margin-left:100px; cursor:pointer;}
    .scbtn{padding:9px 18px;background:#40AFFE;color:#fff;border-radius:5px; display:none;}
    .upimg{position:relative;width:100px;height:100px;background:url(/assets/style/images/addimg.png) no-repeat; background-size:cover; float:left;}
    .upimg input{position:absolute;width:100px;height:100px;opacity:0;}
    #showimg{margin-left: -50px;}
    #showui {
        float: left;
    }
    #showui li .showimg{
        width:100px;
        height:80px;
    }
    #showui li {
        width: 100px;
        height: 100px;
        position: relative;
        overflow: hidden;
        display: inline-block;
        margin-right: 5px;
        margin-bottom: 5px;
    }
    .showdiv {
        position: absolute;
        z-index: 9;
        bottom: 0;
        width: 100%;
        padding: 6px 0;
        display: flex;
        justify-content: space-around;
        background: rgba(0,0,0,.6);
    }
    .showdiv img {
        width: 20px;
        height: 20px;
        cursor: pointer;
    }

    img {
        border-style: none;
        border: 0;
        padding: 0;
        margin: 0;
        display: block;
    }
    .imglist{position: relative;width:100px;height: 80px;float: left;margin-right: 10px;}
    .imglist i.closepic{width: 20px;
        height: 20px;
        display: block;
        position: absolute;
        right: -5px;
        top: -10px;
        cursor: pointer;
        text-align: center;
        line-height: 16px;
        border: 1px solid #333;
        border-radius: 50%;
        font-size: 14px;
        background: #fff;
        font-weight: normal;
        color: #333;}


</style>
<div class="content">
    <form id="add_form" class="form-horizontal nice-validator n-default n-bootstrap" role="form" data-toggle="validator" method="POST" action="" novalidate="novalidate">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">用户:</label>
            <div class="col-xs-12 col-sm-8">
                <span style="margin-top:12px;">{$res.username}</span>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">总体评价:</label>
            <div class="col-xs-12 col-sm-8">
                <select name="pnum">
                    {volist name="evaluation_score" id="vo" key="k"}
                    <option value="{$resArr[$vo]}" {if condition="$resArr[$vo] eq $res.pnum"}selected="selected"{/if}>{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">导游服务:</label>
            <div class="col-xs-12 col-sm-8">
                <select name="guide_num">
                    {volist name="evaluation_score" id="vo" key="k"}
                    <option value="{$resArr[$vo]}" {if condition="$resArr[$vo] eq $res.guide_num"}selected="selected"{/if}>{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">行程安排:</label>
            <div class="col-xs-12 col-sm-8">
                <select name="trip_num">
                    {volist name="evaluation_score" id="vo" key="k"}
                    <option value="{$resArr[$vo]}" {if condition="$resArr[$vo] eq $res.trip_num"}selected="selected"{/if}>{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">餐饮住宿:</label>
            <div class="col-xs-12 col-sm-8">
                <select name="food_num" id="food_num">
                    {volist name="evaluation_score" id="vo" }
                    <option value="{$resArr[$vo]}" {if condition="$resArr[$vo] eq $res.food_num"}selected="selected"{/if} >{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">旅行交通:</label>
            <div class="col-xs-12 col-sm-8">
                <select name="service_num" id="service_num">
                    {volist name="evaluation_score" id="vo" key="k"}
                    <option value="{$resArr[$vo]}" {if condition="$resArr[$vo] eq $res.service_num"}selected="selected"{/if} >{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">状态:</label>
            <div class="col-xs-12 col-sm-8">
                <input  name="mstatus"  value="0" type="radio" {if condition="$res.mstatus eq 0"}checked="checked"{/if}>审核通过显示
                <input  name="mstatus"  value="1" type="radio" {if condition="$res.mstatus eq 1"}checked="checked"{/if}>不显示
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">内容:</label>
            <div class="col-xs-12 col-sm-8" >
                <textarea name="pmsg"  id="pmsg" style="width:300px;height:200px;">{$res.pmsg}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">点评图片:</label>
            <div class="col-xs-12 col-sm-8" id="img_fix">
                {volist name="imgList" id="vo"}
                <div class="imglist">
                    <img src="{$vo.imgadr}" class="img_fix">
                    <i class="closepic" onclick="img_del('{$vo.id}',this);">x</i>
                </div>
                {/volist}
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 ">上传照片</label>
            <div class="col-xs-12 col-sm-8 sc_imgbox">
                <div id="showimg">
                    <ul id="showui"></ul>
                    <div id="showinput"></div>
                </div>
                <div class="upimg">
                    <input type="file" id="upgteimg" value="" multiple />
                </div>
                <button class="scbtn" id="fsubmit">开始上传</button>
            </div>
        </div>
        <div id="img" style="display:none;">

        </div>


        <input type="hidden" name="img_temp" value="0" id="img_temp"/>
        <input type="hidden" name="id" value="{$res.id}" />

        <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button type="button" class="btn btn-success btn-embossed" onclick="fsub();">确定</button>
                <a href="/admin/user_evaluation/index" class="btn btn-default btn-embossed">返回</a>
            </div>
        </div>
    </form>

</div>
<script language="javascript" type="text/javascript" src="/assets/My97DatePicker/jquery-1.8.2.js"></script>

<script src="/assets/style/js/updateimg.js"></script>

<script>
    function img_del(id,obj){
        var img_temp=$("#img_temp").val();
        var str=img_temp+"|"+id;
        $("#img_temp").val(str);
        $(obj).parent('.imglist').css("display","none");
        //$(obj).prev().css("display","none");

    }

    function fsub(){
        var inputstr="";
        $('#showui li').find('img.showimg').each(function(index){
            var imgsrc = $(this).attr('src');
            var inputSrc="<input name='img"+index+"' value='"+imgsrc+"' />";
            inputstr=inputstr+inputSrc;
        });
        console.log(inputstr);
        $("#img").html(inputstr);
        $("#add_form").submit();
    }
</script>

